// 地区相关
import service from '@/utils/request'

import constant from '@/utils/constant'
import Qs from 'qs'

const root = (process.env.NODE_ENV === 'development' ? '/api' : '')


// 返回所有的省
export function getProvinces(params) {
  return service({
    url: root + constant.get_provinces,
    method: 'get',
    params: params,
  })
}
// 根据省代码获取城市
export function getCity(params) {
  return service({
    url: root + constant.get_city,
    method: 'get',
    params: params,
  })
}
// 根据城市获取县
export function getArea(params) {
  return service({
    url: root + constant.get_area,
    method: 'get',
    params: params,
  })
}
// 根据县获取街道
export function getStreet(params) {
  return service({
    url: root + constant.get_street,
    method: 'get',
    params: params,
  })
}
// 进入页面选择快递公司后根据自身级别查询省市区
export function getUserAddress(params) {
  return service({
    url: root + constant.get_user_address,
    method: 'get',
    params: params,
  })
}
